package cn.kgc.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class QueueConfirmCallback  implements RabbitTemplate.ReturnCallback{

    @Override
    public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
        log.error("========消息{} 经过交换机 {} 通过routingKey={} 路由到队列失败，失败code为：{}， 失败原因为：{}", new String(message.getBody()), exchange, routingKey, replyCode, replyText);
    }
}